﻿// Study0705.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// 第七章 继承 派生产生的隐藏和二义性

#include <iostream>
using namespace std;

class Base1
{
public:
	int var=1;
	void func()
	{
		cout << "调用Base1类的function。" << endl;
	}
};
class Base2
{
public:
	int var=2;
	void func()
	{
		cout << "调用Base2类的function。" << endl;
	}
};

class Derived:public Base1,public Base2
{
public:

	void func()
	{
		cout << "调用Derived类的function。" << endl;
	}
	
};
int main()
{
	Derived der;
	der.func();
	cout << der.Base1::var << endl;

	return 0;
}

